'\" t
.\"     Title: cg_annotate
.\"    Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 11/01/2024
.\"    Manual: cg_annotate
.\"    Source: Release 3.24.0
.\"  Language: English
.\"
.TH "CG_ANNOTATE" "1" "11/01/2024" "Release 3\&.24\&.0" "cg_annotate"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
cg_annotate \- post\-processing tool for Cachegrind
.SH "SYNOPSIS"
.HP \w'\fBcg_annotate\fR\ 'u
\fBcg_annotate\fR [\fIoptions\fR] \fIcachegrind\-out\-file\fR [\fIsource\-files\fR...]
.SH "DESCRIPTION"
.PP
\fBcg_annotate\fR
takes one or more Cachegrind output files and prints data about the profiled program in an easy\-to\-read form\&.
.SH "OPTIONS"
.PP
\fB\-h \-\-help \fR
.RS 4
Show the help message\&.
.RE
.PP
\fB\-\-version \fR
.RS 4
Show the version number\&.
.RE
.PP
\fB\-\-diff \fR
.RS 4
Diff two Cachegrind output files\&.
.RE
.PP
\fB\-\-mod\-filename <regex> [default: none]\fR
.RS 4
Specifies an
\fBs/old/new/\fR
search\-and\-replace expression that is applied to all filenames\&. Useful when differencing, for removing minor differences in paths between two different versions of a program that are sitting in different directories\&. An
\fBi\fR
suffix makes the regex case\-insensitive, and a
\fBg\fR
suffix makes it match multiple times\&.
.RE
.PP
\fB\-\-mod\-funcname <regex> [default: none]\fR
.RS 4
Like
\fB\-\-mod\-filename\fR, but for filenames\&. Useful for removing minor differences in randomized names of auto\-generated functions generated by some compilers\&.
.RE
.PP
\fB\-\-show=A,B,C [default: all, using order in the Cachegrind output file] \fR
.RS 4
Specifies which events to show (and the column order)\&. Default is to use all present in the Cachegrind output file (and use the order in the file)\&. Best used in conjunction with
\fB\-\-sort\fR\&.
.RE
.PP
\fB\-\-sort=A,B,C [default: order in the Cachegrind output file] \fR
.RS 4
Specifies the events upon which the sorting of the file:function and function:file entries will be based\&.
.RE
.PP
\fB\-\-threshold=X [default: 0\&.1%] \fR
.RS 4
Sets the significance threshold for the file:function and function:files sections\&. A file or function is shown if it accounts for more than X% of the counts for the primary sort event\&. If annotating source files, this also affects which files are annotated\&.
.RE
.PP
\fB\-\-show\-percs, \-\-no\-show\-percs, \-\-show\-percs=<no|yes> [default: yes] \fR
.RS 4
When enabled, a percentage is printed next to all event counts\&. This helps gauge the relative importance of each function and line\&.
.RE
.PP
\fB\-\-annotate, \-\-no\-annotate, \-\-auto=<no|yes> [default: yes] \fR
.RS 4
Enables or disables source file annotation\&.
.RE
.PP
\fB\-\-context=N [default: 8] \fR
.RS 4
The number of lines of context to show before and after each annotated line\&. Use a large number (e\&.g\&. 100000) to show all source lines\&.
.RE
.SH "SEE ALSO"
.PP
valgrind(1),
$INSTALL/share/doc/valgrind/html/index\&.html
or
http://www\&.valgrind\&.org/docs/manual/index\&.html\&.
.SH "AUTHOR"
.PP
Nicholas Nethercote\&.
